from .baseform import BaseForm
from wtforms import StringField,IntegerField,BooleanField
from wtforms.validators import InputRequired, Email, Length


class AddStaffForm(BaseForm):
    email = StringField(validators=[Email(message='请输入正确格式的邮箱！')])
    role = IntegerField(validators=[InputRequired(message='请选择角色！')])


class EditStaffForm(BaseForm):
    role = IntegerField(validators=[InputRequired(message='请选择角色！')])
    is_staff = BooleanField(validators=[InputRequired(message='请选择是否是员工！')])


class EditBoardForm(BaseForm):
    name = StringField(validators=[InputRequired(message='请输入板块名称！'),Length(min=2,max=20,message='板块名称长度在2-20个字符之间！')])


class AddBoardForm(BaseForm):
    name = StringField(validators=[InputRequired(message='请输入板块名称！'),Length(min=2,max=20,message='板块名称长度在2-20个字符之间！')])
